package me.zk;

import java.util.concurrent.TimeUnit;

/**
 * @Author: zhang kai
 * @Date: 2022/07/22
 * @Description:
 */
public class Daemon {
    public static void main(String[] args) {
        Thread t = new Thread(new DaemonRunner(),"DaemonRunner");
        t.setDaemon(true);
        t.start();
    }
    static class DaemonRunner implements Runnable {
        @Override
        public void run() {
            try {
                TimeUnit.SECONDS.sleep(100);
            } catch (InterruptedException e) {
                //ignore
            } finally {
                System.out.println("DaemonThread finally run.");
            }
        }
    }
}
